<template>
  <div class="error-page">
    <div class="error-content">
      <h1>404</h1>
      <h2>页面不存在</h2>
      <p>抱歉，您访问的页面不存在或已被删除。</p>
      <div class="error-actions">
        <button @click="goHome" class="btn-primary">返回首页</button>
        <button @click="goBack" class="btn-secondary">返回上一页</button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/home');
};

const goBack = () => {
  router.go(-1);
};
</script>

<style scoped>
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f5f5;
}

.error-content {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-content h1 {
  font-size: 72px;
  color: #ff4757;
  margin: 0;
  font-weight: bold;
}

.error-content h2 {
  font-size: 24px;
  color: #2f3542;
  margin: 10px 0;
}

.error-content p {
  color: #747d8c;
  margin: 20px 0;
  font-size: 16px;
}

.error-actions {
  margin-top: 30px;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  margin: 0 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #3742fa;
  color: white;
}

.btn-primary:hover {
  background-color: #2f3542;
}

.btn-secondary {
  background-color: #f1f2f6;
  color: #2f3542;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background-color: #e9ecef;
}
</style>